Random = Mock.Random

function getCarouselRes(){
    let data = []

    for(let i = 0; i < 3; i++){
        data.push(Mock.mock({
            image: Random.image()
        }))
    }

    return {
        data,
        code : 200,
        msg : '获取成功'
    }
}

function getKindsPetsRes(){
    let data = []

    for(let i = 0; i < 5; i++){
        let pet_list = []

        for(let j = 0; j < 8; j++){
            let pet = Mock.mock({
                'pet_name' : Random.cname(),
                'image' : Random.image()
            })

            pet_list.push(pet)
        }

        let kind = Mock.mock({
            pet_list,
            'kind' : Random.cname(),
            'image' : Random.image()
        })

        data.push(kind)
    }

    return{
        data,
        code : 200,
        msg : '获取成功'
    }
}

Mock.mock("http://localhost/carousel.php", 'get', getCarouselRes)

Mock.mock("http://localhost/kinds_pets.php", 'get', getKindsPetsRes)